<?php

/**
 * transactions actions.
 *
 * @package    billingSystem
 * @subpackage transactions
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class transactionsActions extends sfActions {

    public function executeIndex(sfWebRequest $request) {
        $this->filter = new TransactionsFormFilter();
        $this->transactions = Doctrine_Core::getTable('Transactions')->findByPid(array($this->getUser()->getAttribute('partnerid')));
        $this->forward404Unless($this->transactions);
    }

    public function executeShow(sfWebRequest $request) {
        $this->transactions = Doctrine_Core::getTable('Transactions')->findByPid(array($request->getParameter('transid')));
        $this->forward404Unless($this->transactions);
    }

    protected function processForm(sfWebRequest $request, sfForm $form) {
        $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
        if ($form->isValid()) {
            $transactions = $form->save();
        }
    }

}
